package org.geektimes.projects.user.validator.bean.validation;

import javax.validation.Constraint;
import javax.validation.Payload;
import javax.validation.constraints.NotNull;
import java.lang.annotation.*;

import static java.lang.annotation.ElementType.*;
import static java.lang.annotation.ElementType.TYPE_USE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
import static org.geektimes.projects.user.validator.bean.validation.IsPhoneNumber.*;

/**
 * @author Sanhong
 */
@Target({ METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER, TYPE_USE })
@Retention(RUNTIME)
@Documented
@Constraint(validatedBy = PhoneNumberValidator.class)
public @interface IsPhoneNumber {
    String message()  default "必须是11位合法的手机号";;

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};
}
